package pack0924;

// 多维数组
public class DemoF {

    public static void a() {
        // 一维数组
        int[] a = {2, 3, 4};
        int[] b = {3, 4, 5};
        int[] c = {5, 6, 7};
        // 二维数组
        int[][] array = {a, b, c};
        // 如何获取元素
        int col = array[2][0];
        System.out.println(col);
    }

    public static void b() {
        int[] a = {2, 3, 4};
        int[] b = {3, 4, 5};
        int[] c = {5, 6, 7};
        // 二维数组
        int[][] array = {a, b, c};
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j] + ",");
            }
            System.out.println();
        }
    }

    // 高维数组中存放的低维数组长度可以不一致
    public static void c() {
        int[] a = {2, 3, 4, 5};
        int[] b = {2, 3, 4};
        int[] c = {1, 2, 3, 4, 5, 6, 7};
        int[][] array = {a, b, c};
    }

    public static void main(String[] args) {
        c();
    }
}